package ace.module.stock.core.impl.dao.repository;

import ace.cmp.spring.data.jdbc.querydsl.core.repository.QuerydslJdbcBaseRepository;
import ace.module.stock.core.impl.constant.StockCoreConstant;
import ace.module.stock.core.impl.dao.entity.WmsStock;
import com.baomidou.dynamic.datasource.annotation.DS;
import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * 库存 repository.
 *
 * @author Caspar
 */
@DS(StockCoreConstant.DEFAULT_DATA_SOURCE_NAME)
@Repository
public interface WmsStockRepository extends QuerydslJdbcBaseRepository<WmsStock, Long> {

  List<WmsStock> findByWmsAppIdAndObjectIdInAndObjectTypeAndDeleteFlag(Long wmsAppId, List<Long> objectIds, Integer objectType, Long deleteFlag);

  WmsStock findByWmsAppIdAndObjectIdAndObjectTypeAndDeleteFlag(Long wmsAppId, Long objectId, Integer objectType, Long deleteFlag);

  List<WmsStock> findByIdInAndWmsAppIdAndObjectTypeAndDeleteFlag(List<Long> ids, Long wmsAppId, Integer objectType, Long deleteFlag);
}